<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8">
		<title>{% block title %}超级管理员{% endblock %}</title>
		{% block include %}
		{% load static %}
		<!--引入layui的css文件和js文件-->
		<link rel="stylesheet" type="text/css" href="{% static 'layui-v2.6.8/layui/css/layui.css' %}" />
		<script src="{% static 'layui-v2.6.8/layui/layui.js' %}" type="text/javascript" charset="utf-8"></script>
		<!--引入附加的index.css文件-->
		<link rel="stylesheet" type="text/css" href="{% static 'CSS/index.css' %}" />
		{% endblock %}
	</head>
	{% block elseinclude %}
	<style>
		.layui-tab-title>li {
			font-size: 18px;
		}

		.layui-tab-title>li:hover {
			font-size: 30px;
		}
	</style>
	{% endblock %}
	<body style="background-color:#F5F5F5">
		{% block subject %}
		<header>
			<!--首页导航	-->
			<ul class="layui-nav" style="display:flex;justify-content:center;">
				<li class="layui-nav-item layui-this"><a href="/superadmin" style="font-size:24px;">管理员</a></li>
			</ul>
		</header>

		<main style="height:1200px;">
			<!--菜单栏-->
			<div class="layui-tab layui-tab-brief">
				<ul class="layui-tab-title" style="display:flex;justify-content:center;">
					<li class="layui-this">用户管理</li>
					<li class="">设备管理</li>
					<li class="">订单管理</li>
					<li class="">留言管理</li>
				</ul>
				<div class="layui-tab-content" style="padding:0;">
					<!--用户表-->
					<div class="layui-tab-item layui-show">
						<div id="users" style="width:100%;margin:0 auto;box-shadow:0px 0px 3px #000000;">
							<table class="layui-table" lay-even>
								<caption style="font-size:26px;color:#333333;margin:0 auto;background-color:#e3e5e8;">用户
								</caption>
								<tr>
									<th>序号</th>
									<th>
										用户ID
										<a style="font-size:18px;color:#028d0f;margin-left:20px;"
											href="/washer/register">添加用户</a>
									</th>
									<th>用户名</th>
									<th>性别</th>
									<th>年龄</th>
									<th>密码</th>
									<th>更新时间</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
								{% for u in users.values %}
								<tr>
									<td>{{ forloop.counter }}</td>
									<td>{{ u.uid }}</td>
									<td>{{ u.uname }}</td>
									{% if u.ugender == False %}
									<td>男</td>
									{% else %}
									<td>女</td>
									{% endif %}
									<td>{{ u.uage }}</td>
									<td>{{ u.upassword }}</td>
									<td>{{ u.uupdate_time }}</td>
									<td>{{ u.ucreate_time }}</td>
									<td>
										<a style="font-size:18px;color:#001fbd;"
											href="/superadmin/edituser/{{u.uid}}">编辑</a>
										<a style="font-size:18px;color:#DC143C;margin-left:20px;"
											href="/superadmin/deluser/{{u.uid}}"
											onclick="return confirm('\n此操作不可逆！\n\r且可能导致未知错误！\n\r确认删除该用户？')">删除</a>
									</td>
								</tr>
								{% empty %}
								<tr>
									<td>平</td>
									<td>台</td>
									<td>还</td>
									<td>没</td>
									<td>有</td>
									<td>任</td>
									<td>何</td>
									<td>用</td>
									<td>户</td>
								</tr>
								{% endfor %}
							</table>
						</div>
					</div>
					<!--设备表-->
					<div class="layui-tab-item">
						<div id="washers" style="width:100%;margin:0 auto;box-shadow:0px 0px 3px #000000;">
							<table class="layui-table" lay-even>
								<caption style="font-size:26px;color:#333333;margin:0 auto;background-color:#e3e5e8;">设备
								</caption>
								<tr>
									<th>序号</th>
									<th>
										设备ID
										<a style="font-size:18px;color:#028d0f;margin-left:20px;"
											href="/washapp/create">添加设备</a>
									</th>
									<th>状态</th>
									<th>更新时间</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
								{% for w in washers.values %}
								<tr>
									<td>{{ forloop.counter }}</td>
									<td>{{ w.wmid }}</td>
									{% if w.wmstate == False %}
									<td>可使用</td>
									{% else %}
									<td>不可用</td>
									{% endif %}
									<td>{{ w.wmupdate_time }}</td>
									<td>{{ w.wmcreate_time }}</td>
									<td>
										<a style="font-size:18px;color:#001fbd;"
											href="/superadmin/editwasher/{{w.wmid}}">编辑</a>
										<a style="font-size:18px;color:#DC143C;margin-left:20px;"
											href="/superadmin/delwasher/{{w.wmid}}"
											onclick="return confirm('\n此操作不可逆！\n\r确认删除该设备？')">删除</a>
									</td>
								</tr>
								{% empty %}
								<tr>
									<td>暂</td>
									<td>无</td>
									<td>可</td>
									<td>用</td>
									<td>设</td>
									<td>备</td>
								</tr>
								{% endfor %}
							</table>
						</div>
					</div>
					<!--订单表-->
					<div class="layui-tab-item">
						<div id="order" style="width:100%;margin:0 auto;box-shadow:0px 0px 3px #000000;">
							<table class="layui-table" lay-even>
								<caption style="font-size:26px;color:#333333;margin:0 auto;background-color:#e3e5e8;">订单
								</caption>
								<tr>
									<th>序号</th>
									<th>订单ID</th>
									<th>用户ID</th>
									<th>设备ID</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
								{% for o in order.values %}
								<tr>
									<td>{{ forloop.counter }}</td>
									<td>{{ o.id }}</td>
									<td>{{ o.user_id }}</td>
									<td>{{ o.washer_id }}</td>
									<td>{{ o.timer }}</td>
									<td>
										<a style="font-size:18px;color:#9c9c9c;" href="javascript:;">编辑</a>
										<a style="font-size:18px;color:#DC143C;margin-left:20px;"
											href="/superadmin/delorder/{{o.id}}"
											onclick="return confirm('\n此操作不可逆！\n\r且可能导致异常！\n\r确认删除该订单？')">删除</a>
									</td>
								</tr>
								{% empty %}
								<tr>
									<td>查</td>
									<td>询</td>
									<td>不</td>
									<td>到</td>
									<td>订</td>
									<td>单</td>
								</tr>
								{% endfor %}
							</table>
						</div>
					</div>
					<!--留言-->
					<div class="layui-tab-item">
						<div id="note">
							<h1 style="color:#05295c;margin-bottom:10px;text-shadow:-2px -3px 5px #282601;">社区留言</h1>
							{% load static %}
							{% for n in note.values %}
							<div class="onview"
								style="background-color:#e3e5e8;padding:14px;border-left:8px solid #708090;border-bottom:1px solid #708090;">
								<div style="font-size:18px;">
									<h3 style="color:#1E90FF;margin-bottom:3px;">
										{{forloop.counter}}.&nbsp;&nbsp;{{n.title}}
									</h3>
									<p>
										<img src="{% static 'img/timer16.png' %}" alt="时间"
											style="margin-left:60%;">&nbsp;{{n.update_time}}
									</p>
									<p>&emsp;&emsp;{{n.content}}</p>
									<p>
										<img src="{% static 'img/user16.png' %}" alt="用户"
											style="margin-left:60%;">&nbsp;{{n.user_id}}
										<a style="font-size:20px;color:#001fbd;margin-left:20px;"
											href="/superadmin/editnote/{{n.id}}/{{n.title}}">编辑</a>
										<a style="font-size:20px;color:#DC143C;margin-left:20px;"
											href="/superadmin/delnote/{{n.id}}/{{n.title}}"
											onclick="return confirm('\n此操作不可逆！\n\r确认删除该留言？')">删除</a>
									</p>
								</div>
							</div>
							{% empty %}
							<h2>社区无任何用户留言！</h2>
							{% endfor %}
						</div>
					</div>
				</div>
			</div>
		</main>

		<footer>

		</footer>
		{% endblock %}
	</body>
</html>
